#include <iostream>
#include "WindowsApplication.h"
#include "Model/SphereMesh.h"
#include "Model/BoxMesh.h"
#include "test.h"
int main() {

    WindowsApplication* test = new WindowsApplication();
    test->Initialize();
    GameTimer *timer = new GameTimer();
    timer->Reset();
    IMesh* mesh = new BoxMesh(1,1,1);
    BoxMesh* pointLight = new BoxMesh(0.1,0.1,0.1);
    pointLight->SetColor({1.f,1.f,1.f,1.f});
    //IMesh* mesh = new SphereMesh({0,0,0},3);
    Object tmpO(mesh);
    Object tmp1(pointLight);
    //tmpO.RotateX(60);
    tmpO.RotateY(60);
    tmpO.Translate({0.f,1.3f,0.f});
    tmp1.Translate({-1.f,1.f,0.f});
    test->getRenderPipeline()->AddObject(tmpO);
    tmpO.Translate({-1.f,-0.f,0.f});
    test->getRenderPipeline()->AddObject(tmpO);
    tmpO.Translate({1.f,-0.f,0.f});
    test->getRenderPipeline()->AddObject(tmpO);
    test->getRenderPipeline()->AddObject(tmp1);
    test->getRenderPipeline()->AddPointLight({glm::vec3(-1.f,1.f,0.f),2});
    /* VertexOut p1({0.f,0.f,-5.f,1.f},{0.f,1.f,0.f,1.f},{0.f,0.f},{0.f,0.f,0.f});
    VertexOut p2({-1.f,0.f,-5.f,1.f},{0.f,0.f,1.f,1.f},{0.f,0.f},{0.f,0.f,0.f});
    VertexOut p3({0.f,-1.f,-5.f,1.f},{1.f,0.f,0.f,1.f},{0.f,0.f},{0.f,0.f,0.f});
    std::vector<VertexOut> tri = {p1,p2,p3};
    std::vector<int> idx = {0,1,2}; */

    while(!test->bShouldClose){
        test->getRenderPipeline()->Tick(timer);
        test->Tick(timer);
        test->getRenderPipeline()->Clear();
        timer->Tick();
        //std::cout<<1.0/timer->DeltaTime()<<'\n';
    }
    //testInsideTriangle();
    //testSphereMesh();
    return 0;
}
